//
//  CustomSegmentView.h
//  MaiJianBaseProject
//
//  Created by Michael Fan on 14-7-11.
//  Copyright (c) 2014年 Michael Fan. All rights reserved.
//
/*
 自定义segmentview-2个或者3个的选项卡
 用法-
 xib中拖view和btn-关联btn和btn事件-设置btn的tag-返回的index为当前所选按钮tag。
 */

#import <UIKit/UIKit.h>

@protocol CustomSegmentViewDelegate;

@interface CustomSegmentView : UIView
{
    IBOutlet UIButton *btn01;
    IBOutlet UIButton *btn02;
    IBOutlet UIButton *btn03;
    IBOutlet UIButton *btn04;
    IBOutlet UIButton *btn05;
    IBOutlet __weak id <CustomSegmentViewDelegate> delegate;
}

PROPERTY_ASSIGN NSInteger selectedIndex;
@property(nonatomic,weak) id <CustomSegmentViewDelegate> delegate;
@property(nonatomic,strong) UIColor *normalColor;
@property(nonatomic,strong) UIColor *highlightedColor;

@property(nonatomic,strong) UIScrollView *toScroller;

//设置image或backgroundimage-默认为no为backgroundimage
PROPERTY_ASSIGN BOOL imageOrBackgroundImage;

-(void)updateTextColor;

//单纯界面修改到index-不修改selectedIndex不出发协议方法
-(void)viewBecomeToIndex:(NSInteger)toIndex;

@end


@protocol CustomSegmentViewDelegate <NSObject>

@optional

-(void)customSegDidSelected:(CustomSegmentView *)segmentView;

-(void)customSegDidTapSelectedItem:(CustomSegmentView *)segmentView;

@end















